import com.sun.org.apache.xpath.internal.objects.XObject;
class Money implements Cloneable{
    public int m=100;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class Person implements Cloneable{
    public int age;
    public String name;
    public Money money=new Money();
    public Person(int age,String name) {
        this.age=age;
        this.name=name;
    }
    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp=(Person) super.clone();
        tmp.money=(Money) this.money.clone();
        return tmp;
    }
   /* @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }*/
}
public class Clone {
    public static void main(String[] args) throws CloneNotSupportedException{
        Person person=new Person(2,"x");
        Person person2=(Person) person.clone();
        Money money=new Money();
        Money money1=(Money) money.clone();
        System.out.println(person.money.m);
        person2.money.m=120;
        System.out.println(person2.money.m);
        System.out.println(person2.name);
        System.out.println(person2.age);
    }
}